using System;
using System.Collections.Generic;

namespace DOJ.LEISP.LEXS.Common.Providers
{
    /// <summary>
    /// Default capabilities provider implementation.
    /// </summary>
    public class DefaultCapabilitiesProvider : ICapabilitiesProvider
    {
        /// <summary>
        /// Returns a list of the capabilities supported by this implementation.
        /// </summary>
        /// <returns></returns>
        public CapabilitiesType GetCapabilities()
        {
            CapabilitiesType capabilities = new CapabilitiesType
            {
                PagingIndicator = false,
                MaxHitsReturned = "50",
                DataItemCategory = GetCategories().ToArray(),
                StructuredSearch = new StructuredSearchType() 
                { 
                    FuzzySearchIndicator = false, 
                    MultipleValueIndicator = true, 
                    WildcardIndicator = true, 
                    DateRangeIndicator = true, 
                    NumericRangeIndicator = true 
                }
            };
            return capabilities;
        }


        private static List<DataItemCategoryType> GetCategories()
        {
            List<DataItemCategoryType> categories = new List<DataItemCategoryType>();
            categories.Add(new DataItemCategoryType { DataItemCategoryDescription = "Incident Reports", DataItemCategoryText = "Incident" });
            categories.Add(new DataItemCategoryType { DataItemCategoryDescription = "Arrest Reports", DataItemCategoryText = "Arrest" });

            return categories;
        }
    }
}
